/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hitechbangla.fctu.drawingTools;

import fctu.simulator.HTB_MAIN;
import java.awt.Graphics;

/**
 *
 * @author Bikash HTB
 */
public class LineDrawable implements DrawableFigure{
    
    double firstPointX, firstPointY, secondPointX, secondPointY;
    
    public LineDrawable(double firstPointX, double firstPointY, double secondPointX, double secondPointY)
    {
        this.firstPointX = firstPointX;
        this.firstPointY = firstPointY;
        this.secondPointX = secondPointX;
        this.secondPointY = secondPointY;
    }

    @Override
    public void draw(Graphics g) {
        //throw new UnsupportedOperationException("Not supported yet.");
        
        int fpX = (int) (firstPointX*HTB_MAIN.one_px_equivalent_naut);
        int fpY = (int) (firstPointY*HTB_MAIN.one_px_equivalent_naut);   
        int spX = (int) (secondPointX*HTB_MAIN.one_px_equivalent_naut);
        int spY = (int) (secondPointY*HTB_MAIN.one_px_equivalent_naut);   
        
        g.drawLine(fpX, fpY, spX, spY);
    }
    
}
